/*
 *         (C) COPYRIGHT Ingenic Limited
 *              ALL RIGHT RESERVED
 *
 * File：        common_type.h
 * Author：      lzwang
 * Create Time： 2024-04-08 22:08:05
 * Description:
 */
#ifndef __MAGIK_URANUS_COMMON_COMMON_TYPE_H__
#define __MAGIK_URANUS_COMMON_COMMON_TYPE_H__
#include "common_def.h"

namespace magik {
namespace uranus {
ALG_PACK_START

enum class ChannelLayout : int URANUS_API {
    NONE = -1,
    NV12 = 0,
    BGRA = 1,
    RGBA = 2,
    ARGB = 3,
    RGB = 4,
    GRAY = 5,
    FP = 6
};

enum class TransformType : int URANUS_API {
    NONE = -1,
    NV12_NV12 = 0,
};

enum class DataType : int URANUS_API {
    NONE = -1, /*is not supported*/
    /*48bit sum ??*/
    FP32 = 0,
    UINT32 = 1,
    INT32 = 2,
    /*only support for w*/
    UINT20 = 3,
    INT20 = 4,
    UINT16 = 5,
    INT16 = 6,
    UINT12 = 7,
    INT12 = 8,
    UINT8 = 9,
    INT8 = 10,
    UINT4B = 11,
    INT4B = 12,
    BOOL = 13,
    UINT2B = 14,
    UINT10 = 15,
    INT10 = 16,
    UINT14 = 17,
    INT14 = 18,
};

enum class DataFormat : int URANUS_API {
    NONE = -1,
    /*
     * 1. image format.
     * (1). BGR0, eg: shape=[1, 3, 6, 4]:
     * +------------------------+
     * |BGR0BGR0BGR0BGR0BGR0BGR0|
     * |BGR0BGR0BGR0BGR0BGR0BGR0|
     * |BGR0BGR0BGR0BGR0BGR0BGR0|
     * +------------------------+
     * (2). RGB0, eg: shape=[1, 3, 6, 4]:
     * +------------------------+
     * |RGB0RGB0RGB0RGB0RGB0RGB0|
     * |RGB0RGB0RGB0RGB0RGB0RGB0|
     * |RGB0BGR0BGR0RGB0RGB0RGB0|
     * +------------------------+
     * (3). GRAY, eg: shape=[1, 3, 24, 1]:
     * +------------------------+
     * |YYYYYYYYYYYYYYYYYYYYYYYY|
     * |YYYYYYYYYYYYYYYYYYYYYYYY|
     * |YYYYYYYYYYYYYYYYYYYYYYYY|
     * +------------------------+
     * 2.Feature layout
     * [N_BATCH, HEIGHT, WIDTH, CHN]
     */
    NHWC = 0,
    /*
     * Feature layout, eg fp, coord
     * [N_BATCH, D_C, HEIGHT, WIDTH, CHN_PACK]
     */
    NDHWC8 = 1,
    /*
     * Feature layout, eg fp, coord
     * [N_BATCH, HEIGHT, D_C, WIDTH, CHN_PACK]
     */
    NHDWC8 = 2,
    /*
     * Weight layout
     * [KERNEL_H, KERNEL_W, I_CHN, O_CHN]
     */
    HWIO = 3,
    /*
     * Weight layout, eg weight
     * [N_OFP, M_IFP, KERNEL_H, KERNEL_W, S_BIT4, OFP, IFP]
     */
    NMHWSOIB4 = 4,
    /*
     *Weight layout, eg bt
     *[N_OFP, M_BT, CHN_PACK]
     */
    NMC = 5,
    /*
     *Weight layout, eg scale/lut
     *[d1]
     */
    D1 = 6,
    /*
     * image format for nv12.
     * eg: shape=[1, 4, 24, 1]:
     * +------------------------+
     * |YYYYYYYYYYYYYYYYYYYYYYYY|
     * |YYYYYYYYYYYYYYYYYYYYYYYY|
     * |YYYYYYYYYYYYYYYYYYYYYYYY|
     * |YYYYYYYYYYYYYYYYYYYYYYYY|
     * +------------------------+
     * |UVUVUVUVUVUVUVUVUVUVUVUV|
     * |UVUVUVUVUVUVUVUVUVUVUVUV|
     * +------------------------+
     */
    NV12 = 7,
    /*
     * Weight layout
     * [O_CHN, KERNEL_H, KERNEL_W, I_CHN]
     */
    OHWI = 8,
    /*
     * Feature layout
     * [N_BATCH, CHN, HEIGHT, WIDTH]
     */
    NCHW = 9,
    /*
     * Feature layout
     * [N_BATCH, CHN]
     */
    NC = 10,
    /*
     * Feature layout
     * [N_BATCH, WIDTH, CHN]
     */
    NWC = 11,
    /*
     * [N_BATCH, HEIGHT, WIDTH, CHN1, CHN2]
     */
    NHWC1C2 = 12,
    /*
     * [N_BATCH, HEIGHT, WIDTH, CHN1, CHN2, CHN3]
     */
    NHWC1C2C3 = 13,
    /*
     * [N_BATCH, HEIGHT, WIDTH, CHN1, CHN2, CHN3, CHN4]
     */
    NHWC1C2C3C4 = 14,
    NMC32 = 15,

};

enum class DataLocation : int URANUS_API { NONE = -1, DDR = 0, ORAM = 1 };

enum class Device : int URANUS_API {
    /*Unsupported*/
    NONE = -1,
    /*nmem, alloc memory by mudata*/
    CPU = 1,
    /*RAM of NPU, alloc memory by mudata, users disabled*/
    AIE = 2,
    /*external DDR memory(nmem, rmem, ...), must be contiguous memory block and aligned with 64
       bytes*/
    EXT_CPU = 3,
    /*external NPU RAM, must be contiguous memory block and aligned with 64 bytes*/
    EXT_AIE = 4,
};

ALG_PACK_END
} // namespace uranus
} // namespace magik
#endif /* __MAGIK_URANUS_COMMON_COMMON_TYPE_H__ */
